#!/usr/bin/python

from distutils.core import setup, Extension
import os 

# the c++ extension module 
sources = ["src/egluepy.c","src/egdebug.c","src/egluesh.c","../sift-macos/src/xform.c"]
if os.name == 'posix':  # MAC
  extension_eglue = Extension("eglue", sources, 
    include_dirs=["../zxing/core/src",
                  "../klt-macos",
                  "../sift-macos/include",
                  "/Library/Frameworks/OpenCV.framework/Headers",
		  "/sw/include"], 
    library_dirs=["/sw/lib",".","../klt-macos","../sift-macos/lib"], 
    libraries=["gsl","feat","klt","cxcore","cv","highgui","cvaux","ml"], 
    extra_link_args=["-arch i386 -F/Library/Frameworks/Gtk.framework -framework Gtk"],
    define_macros=[("__MACOS__",None)]) 
else:
  if os.name == 'nt': # Windows XP
     extension_eglue = Extension("eglue", sources, 
                           include_dirs=["core/src",
                                         "C:/OpenCV1.1prea/cv/include", 
                                         "C:/OpenCV1.1prea/cvaux/include", 
                                         "C:/OpenCV1.1prea/cxcore/include", 
                                         "C:/OpenCV1.1prea/otherlibs/highgui",
                                         "C:/MinGW/mingw32/include",
                                         "C:/pthreads280/include"], 
                           library_dirs=["build",
                                         "C:/OpenCV1.1prea/lib",
                                         "C:/MinGW/bin",
                                         "C:/MinGW/lib",
                                         "C:/pthreads280/lib",
                                         "C:/GnuWin32/lib"], 
                           libraries=["zxing","cxcore","cv","highgui","cvaux","ml","pthreadGC2","iconv"],
                           define_macros=[("DEBUG0",None),
                                          ("DEBUGCAMoff",None),
                                          ("OPENCV1_1",None),
                                          ("__NT__",None)], 
                           extra_compile_args=[])     
  else:
    extension_eglue = Extension("eglue", sources, 
                          include_dirs=["core/src"], 
                          library_dirs=["build"], 
                          libraries=["zxing","cxcore","cv","highgui","cvaux","ml"], 
                          runtime_library_dirs=["build"],
                          define_macros=[("DEBUG0",None)], 
                          extra_compile_args=[]) 

setup(name="eglue", version="0.1.0", author="Leonardo Shiguemi Dinnouti",
      description="Utility to glue two or more images togheter",
      author_email="leonardo.dinnouti@gmail.com", url="http://eglue.openmobo.org/",
      ext_modules=[extension_eglue]) 
